import request from '../utils/request'

// 搜索相关API接口

export const searchApi = {
  // 搜索商品
  searchProducts: (params) => request.get('/search/product', { params }),
  
  // 获取搜索建议
  getSearchSuggestions: (keyword) => request.get('/search/suggestions', { params: { keyword } }),
  
  // 获取搜索热词
  getHotKeywords: () => request.get('/search/hot-keywords'),
  
  // 搜索统计
  getSearchStatistics: (params) => request.get('/search/statistics', { params }),
  
  // 重建索引
  rebuildIndex: () => request.post('/search/index/rebuild'),
  
  // 刷新索引
  refreshIndex: () => request.post('/search/index/refresh'),
  
  // 获取索引状态
  getIndexStatus: () => request.get('/search/index/status'),
  
  // 搜索日志查询
  getSearchLogList: (params) => request.get('/search/log/list', { params })
}

export default searchApi